As an image processing technique for reducing random noise generated in an image acquired by an image capturing apparatus such as a digital camera, for example, an algorithm called Non-local Means is known. An image processing apparatus using this algorithm outputs, as a new pixel value of a target pixel, an average pixel value obtained by performing a weighted-average on pixel values of neighbor pixels of the target pixel.
Weights used in the weighted-averaging processing are controlled by a parameter. This parameter will be referred to as a smoothing strength hereinafter. When a high smoothing strength is set to effectively reduce noise, a blur is generated in a texture (or pattern) part in an image, thus consequently losing sharpness of the image. Conversely, when a low smoothing strength is set to maintain the sharpness of an image, noise cannot be sufficiently reduced, and unevenness is generated in a flat part in the image. Conventionally, the smoothing strength assumes a fixed value for one image. That is, the same smoothing strength is used for respective pixels in an image. For this reason, both noise removal and maintenance of sharpness cannot be achieved at the same time.
Therefore, an image processing apparatus which can sufficiently remove noise while maintaining sharpness of an image is demanded.